"""Qshop URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path,include  # 第五种方式还需导入include
from Store.views import *

# # viewset改变路由（第四种方式路由设置）
# mores_list = MoreListView.as_view(
#     {
#         "get":"list"
#     }
# )

# 第五种方式路由的设置
from rest_framework.routers import DefaultRouter

router = DefaultRouter()
router.register("morelistview", MoreListView, basename="")  # 注册视图

urlpatterns = [
    path('admin/', admin.site.urls),
    path('reqtest/', reqtest),
    path('register/', register),
    path('login/', login),
    path('base/', base),
    path('user_info/', user_info),
    path('registerform/', registerform),
    path('cookietest/', cookietest),
    path('sessiontest/', sessiontest),
    path('index/', index),
    path('logout/', logout),
    path('list/', list),
    path('add/', add),
    path('goods/', goods),
    path('goodss/', goodss),

    # from django.views.decorators.csrf import csrf_exempt
    # path('goodss/', csrf_exempt(goodss)),  # csrf 拦截的第二种方式，适用于函数视图、类视图

    path('goodssview/', Goodss.as_view()),
    # path('morelistview/', MoreListView.as_view()),  # 前三种方式的路由
    # path('morelistview/', mores_list),  # 第四种方式的路由
    path("",include(router.urls))  # 第五种方式的路由
]
